﻿Imports UtilPadrao
Public Class ctrModulos

#Region "Variáveis"

    Private objModulos As New Persistencia.perModulos

#End Region

#Region "Métodos"

    Public Function listarModulos() As DataTable

        Try
            Return Me.objModulos.listarModulos
        Catch ex As Exception
            Throw New Exception(ex.Message)
        End Try

    End Function

    Public Function listarUsuarioModulos(ByVal sCodModulos As String) As DataTable

        Try
            Return Me.objModulos.listarUsuarioModulos(sCodModulos)
        Catch ex As Exception
            Throw New Exception(ex.Message)
        End Try

    End Function

    Public Function selecionarModulos() As DataTable

        Try
            Return Me.objModulos.selecionarModulos()
        Catch ex As Exception
            Throw New Exception(ex.Message)
        End Try

    End Function

    Public Sub gravarModulos(ByVal datModulos As DataTable)

        Try

            For Each drDados As DataRow In datModulos.Rows

                Me.objModulos.editarModulos(conversao.toInt32(drDados.Item("codModulo")),
                                            conversao.nuloParaVazio(drDados.Item("caminhoExe")),
                                            conversao.nuloParaVazio(drDados.Item("caminhoAtu")))

            Next

        Catch ex As Exception
            Throw New Exception(ex.Message)
        End Try

    End Sub

#End Region

End Class
